package com.vayne.demo;

import com.alibaba.dubbo.common.extension.ExtensionLoader;
import com.vayne.api.Robot;

/**
 * Test Dubbo SPI
 *
 * @author xuerui.zhang
 * @since 2020/6/4 上午10:43
 */
public class DubboSPIDemo {

    public static void main(String[] args) throws Exception {
        sayHello();
    }

    public static void sayHello() throws Exception {
        ExtensionLoader<Robot> extensionLoader = ExtensionLoader.getExtensionLoader(Robot.class);
        Robot optimusPrime = extensionLoader.getExtension("optimusPrime");
        optimusPrime.sayHello();
        Robot bumblebee = extensionLoader.getExtension("bumblebee");
        bumblebee.sayHello();
    }
}
